package com.guochenglang.www.dao.impl;

import com.guochenglang.www.dao.LikeMessageDao;
import com.guochenglang.www.pojo.LikeMessage;
import com.guochenglang.www.util.GetTable;
import com.guochenglang.www.util.connect.JdbcUtil;

import java.sql.SQLException;
import java.util.ArrayList;

/**
 * 点赞消息提醒的Dao层
 *
 * @author GuoChenglang
 */
public class LikeMessageDaoImpl implements LikeMessageDao {
    /**
     * 表名
     */
    private static final String TABLE = GetTable.getTable(LikeMessage.class);

    @Override
    public ArrayList<LikeMessage> likeMessageSelect(LikeMessage conditions) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException {
        return JdbcUtil.selectMax(TABLE, conditions);
    }

    @Override
    public int insertLikeMessage(LikeMessage comfort) throws SQLException, InterruptedException, IllegalAccessException {
        return JdbcUtil.insert(TABLE, comfort);
    }

    @Override
    public int deleteLikeMessage(LikeMessage conditions) throws SQLException, InterruptedException, IllegalAccessException {
        return JdbcUtil.delete(TABLE, conditions);
    }

    @Override
    public int updateLikeMessage(LikeMessage set, LikeMessage conditions) throws SQLException, InterruptedException, IllegalAccessException {
        return JdbcUtil.update(TABLE, set, conditions);
    }
}
